﻿CREATE TABLE [dbo].[DeviceDom] (
    [Id]               INT       IDENTITY (1, 1) NOT NULL,
    [SchemaId]         CHAR (40) NOT NULL,
    [SchemaXml]        XML       NULL,
    [Version]          INT       NOT NULL,
    [RootDeviceId]     INT       NULL,
    [DomType]          CHAR (1)  NOT NULL,
    [MaxSpecParsed]    BIT       NOT NULL,
    [Created]          DATETIME  NOT NULL,
    [Manufacturer]     AS        ([dbo].[ManufacturerFromSchemaXml]([SchemaXml])),
    [ManufacturerUrl]  AS        ([dbo].[ManufacturerUrlFromSchemaXml]([SchemaXml])),
    [ModelName]        AS        ([dbo].[ModelNameFromSchemaXml]([SchemaXml])),
    [ModelDescription] AS        ([dbo].[ModelDescriptionFromSchemaXml]([SchemaXml]))
);

